package com.vito.oa.act.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.vito.base.authoriza.model.RoleModel;
import com.vito.oa.act.model.BusinessApproverModel;

public interface OaActApproverMapper {
	public int queryDefinedApproverCount(@Param("processKey") String processKey, @Param("topDeptId") String topDeptId);

	public int querybranchCount(@Param("processKey") String processKey, @Param("topDeptId") String topDeptId);

	public List<Map<String, String>> queryProcessBranchList(@Param("processKey") String processKey,
			@Param("topDeptId") String topDeptId);

	public List<Map<String, String>> queryDefinedApproverList(@Param("processKey") String ProcessKey,
			@Param("topDeptId") String topDeptId);

	public List<Map<String, String>> queryBranchApproverList(@Param("processKey") String processKey,
			@Param("branchId") String branchId, @Param("topDeptId") String topDeptId);

	public List<Map<String, String>> queryUserInfoById(@Param("userId") String[] userId);

	public String queryDeptLeaderByDeptId(@Param("deptId") String deptId);

	public String queryParentDeptId(@Param("deptId") String deptId);

	public List<Map<String, String>> queryUserByRole(@Param("roleId") String roleId);

	public String queryRoleNameById(@Param("roleId") String roleId);

	public String queryDeptNameById(@Param("deptId") String deptId);

	public String getNodeNameById(@Param("processKey") String processKey, @Param("nodeId") String nodeId);

	// 一次性保存实例审批人
	public void saveBusinessApprover(Map approver);

	// 查询实例所有审核人
	public List<Map<String, String>> queryProcessInfo(@Param("processKey") String processKey,
			@Param("businessId") String businessId);

	// 修改节点审核状态
	public void updateApproveStatus(BusinessApproverModel model);

	// 保存节点转交信息
	public void addBusinessApprovar(BusinessApproverModel model);

	// 查询某节点的当前受理人
	public BusinessApproverModel queryaCurrentApprover(@Param("businessId") String businessId,
			@Param("nodeId") String nodeId);

	// 查询某节点的下一节点审批人
	public BusinessApproverModel queryNextApprover(@Param("businessId") String businessId,
			@Param("nodeId") String nodeId);

	// 查询某节点的前一节点审批人
	public BusinessApproverModel queryLastApprover(@Param("businessId") String businessId,
			@Param("nodeId") String nodeId);

	public String queryCompanyRoleRange(@Param("companyId") String companyId);

	public List<Map<String, String>> queryRoleUserInDept(@Param("approvalList") List<Map<String, String>> approvers,
			@Param("deptId") String deptId);

	public List<Map<String, String>> queryRoleUserInDirectDept(
			@Param("approvalList") List<Map<String, String>> approvers, @Param("deptId") String deptId);

	List<RoleModel> queryRoleByDept(Map<String, Object> param);

	public List<Map<String, String>> queryProcessAllNode(@Param("processKey") String processKey,
			@Param("companyId") String companyId);

	public Map<String, String> queryNextNode(@Param("processKey") String processKey,
			@Param("nodeId") String currentNodeId);
}
